/**
********************************************************************************
\file   oplk/basictypes.h

\brief  Basic type definitions for openPOWERLINK

This file contains basic type definitions for openPOWERLINK.
*******************************************************************************/

/*------------------------------------------------------------------------------
Copyright (c) 2016, B&R Industrial Automation GmbH
Copyright (c) 2013, SYSTEC electronic GmbH
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the copyright holders nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------*/
#ifndef _INC_oplk_basictypes_H_
#define _INC_oplk_basictypes_H_

//---------------------------------------------------------------------------
//  definitions of basic types

#if (!defined(_WINDEF_) && !defined(_NTDEF_))   // defined in WINDEF.H, included by <windows.h>
                                                // In kernel defined in NTDEF.h included by <ndis.h>

// --- arithmetic types ---
#ifndef SHORT
#define SHORT short int
#endif

#ifndef USHORT
#define USHORT unsigned short int
#endif

#ifndef INT
#define INT int
#endif

#ifndef UINT
#define UINT unsigned int
#endif

#ifndef LONG
#define LONG long int
#endif

#ifndef ULONG
#define ULONG unsigned long int
#endif

#ifndef ULONGLONG
#define ULONGLONG unsigned long long int
#endif

// --- logic types ---
#ifndef BYTE
#define BYTE unsigned char
#endif

#ifndef WORD
#define WORD unsigned short int
#endif

#ifndef DWORD
#define DWORD unsigned int
#endif

#ifndef QWORD
#define QWORD unsigned long long int
#endif

#ifndef BOOL
#define BOOL unsigned char
#endif

// --- bit sized types ---
#ifndef UINT8
#define UINT8 unsigned char
#endif

#ifndef UINT16
#define UINT16 unsigned short int
#endif

#ifndef UINT32
#define UINT32 unsigned int
#endif

#ifndef UINT64
#define UINT64 unsigned long long int
#endif

#ifndef INT8
#define INT8 char
#endif

#ifndef INT16
#define INT16 short int
#endif

#ifndef INT32
#define INT32 int
#endif

#ifndef INT64
#define INT64 long long int
#endif

// --- alias types ---
#ifndef TRUE
#define TRUE  0xFF
#endif

#ifndef FALSE
#define FALSE 0x00
#endif

#ifndef NULL
#define NULL ((void*)0)
#endif

#endif

/* some standard function pointer types */
typedef void (*VOIDFUNCPTR)(void);
typedef int (*INTFUNCPTR)(void);

#endif /* _INC_oplk_basictypes_H_ */
